#!/usr/bin/env sh

#
# This script update plumber rules. If the plumber is not running, start it.
#

if ! pgrep -x "plumber" > /dev/null
then
    plumber
    sleep 0.5
    9pfuse `namespace`/plumb /tmp/mnt/plumb
fi

cat $HOME/lib/plumbing $PLAN9/plumb/initial.plumbing | 9p write plumb/rules > /dev/null
